using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Net.SourceForge.WURFL.Core;
using Common;

namespace Roaming.view
{
    public partial class Home : System.Web.UI.MasterPage
    {
        protected int cols = 0;
        protected void Page_Load(object sender, EventArgs e)
        {
            string strUA = Request.Headers["USER-AGENT"].ToString();
            if (strUA.ToLower().Contains("opera"))
            {
                if (Request.Headers["X-OperaMini-Phone-UA"] != null)
                    strUA = Request.Headers["X-OperaMini-Phone-UA"].ToString();
            }
            cols = DAL.getColLinkSite(strUA);
            if (cols == 4)
            {
                cols = 3;
            }
            if (Request.ServerVariables["HTTP_ACCEPT"] != null)
            {
                string accept = Request.ServerVariables["HTTP_ACCEPT"];
                if (accept.ToLower().IndexOf("application/vnd.wap.xhtml+xml") != -1)
                    Response.ContentType = "application/vnd.wap.xhtml+xml";
                if (accept.IndexOf("application/xhtml+xml") != -1)
                    Response.ContentType = "application/xhtml+xml";
                if (accept.IndexOf("text/html") != -1)
                    Response.ContentType = "text/html";
            }
        }
    }
}
